<?php
date_default_timezone_set('America/Bogota');
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <?php $this->load->view('head'); ?>
        <link type="text/css" href="<?php echo base_url() . "css/redmond/jquery-ui-1.8.14.custom.css"; ?>" rel="stylesheet" />
        <link type="text/css" href="<?php echo base_url() . "css/estadisticas.css"; ?>" rel="stylesheet" />
        <script src="<?php echo base_url() . "js/jquery-ui-1.8.14.custom.min.js"; ?>" type="text/javascript"></script>
        <title></title>
        <script src="<?php echo base_url() . "js/raphael.js"; ?>" type="text/javascript" charset="utf-8"></script>
        <script src="<?php echo base_url() . "js/g.raphael.js"; ?>" type="text/javascript" charset="utf-8"></script>
        <script src="<?php echo base_url() . "js/g.pie.js"; ?>" type="text/javascript" charset="utf-8"></script>
        <script type="text/javascript">
            $(document).ready(function(){
                $("#fecIni").datepicker({dateFormat:"yy-mm-dd",changeMonth: true,changeYear: true, yearRange: '1941:<?php echo date('Y'); ?>' });
                $("#fecFin").datepicker({dateFormat:"yy-mm-dd",changeMonth: true,changeYear: true, yearRange: '1941:<?php echo date('Y'); ?>' });
<?php $this->load->view('enReady'); ?>
                    }); //fin $(document).ready(function(){
                function fnAbreDetalle(opc){
                    window.open("<?php echo site_url("reporteEmpresa/abreDetalleEstDeser/") . "/"; ?>" + opc, "Detalle", "width=1300,height=500,scrollbars=YES");
                }
        </script>
    </head>
    <body>
        <div id="divEstadistica" ></div>
        <div id="divEstadistica1" >
            <form id="formEstadistica">
                <table >
                    <caption>ESTADÍSTICA DESERCIÓN LABORAL</caption>
                    <tr>
                        <td><label for="fecIni">Fecha de contratación Inicial</label></td>
                        <td><input type="text" id="fecIni" name="fecIni" size="9" title="Fecha Inicial de la consulta" /> </td>
                        <td><label for="fecFin">Fecha de contratación Final</label></td>
                        <td><input type="text" id="fecFin" name="fecFin" size="9" title="Fecha Final de la consulta" /> </td>
                    </tr>
                    <?php if ($this->session->userdata("rolId") == "1") { ?>
                        <tr>
                            <td><label for="empresas">Empresa</label></td>
                            <td><select id="empresas" name="empresas" title="Filtre por una empresa en especifico">
                                    <option value="">Todos</option>
                                    <?php
                                    foreach ($empresas->result() as $row)
                                        echo "<option value='{$row->empresaId}'>{$row->empresaRazon}</option>";
                                    ?>
                                </select>
                            </td>
                        </tr>
<?php } ?>
                    <tr>
                        <td colspan="4" style="text-align: center">
                            <input type="button" value="Consultar" onclick="$('#holder').html('');$('#divEstadistica').load('<?php echo site_url("reporteEmpresa/llamaEstDeser/"); ?>',$('#formEstadistica').serialize());"/>
                        </td>
                    </tr>
                </table>
            </form>
        </div>
        <div id="holder"></div>
    </body>
</html>
